#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023-5-22 9:03
# @Author  : XiangZhi_an
# @File    : 2.1.py
# @Description :
import math

# 列表中的点（修改为间隔不到15个像素的点）
list = [(672, 917), (712, 914), (632, 914), (750, 912), (827, 910), (788, 911), (902, 908), (865, 909), (941, 907),
        (978, 907), (1015, 905), (1124, 904), (1088, 904), (1051, 905), (1160, 903), (1266, 902), (1231, 902),
        (1196, 902), (1301, 901), (1371, 899), (1336, 900), (1472, 898), (1404, 899), (1438, 898), (1506, 897),
        (1538, 896), (1604, 895), (1571, 895), (1668, 893), (1636, 894), (1699, 892), (1730, 890), (713, 873),
        (673, 874), (633, 874), (829, 871), (791, 872), (752, 872), (979, 868), (942, 868), (904, 869), (867, 870),
        (1016, 867), (1089, 866), (1052, 867), (1196, 865), (1161, 865), (1125, 866), (1266, 865), (1231, 865),
        (1404, 863), (1301, 864), (1438, 862), (1369, 862), (1335, 863), (1505, 861), (1666, 859), (1571, 859),
        (1537, 860), (1472, 861), (1635, 858), (1603, 858), (1699, 857), (1729, 856), (712, 834), (673, 835),
        (633, 835), (751, 834), (790, 832), (828, 831), (1013, 830), (940, 830), (903, 830), (1157, 828), (1086, 829),
        (976, 829), (866, 830), (1366, 827), (1331, 828), (1297, 828), (1262, 828), (1228, 828), (1192, 828),
        (1121, 828), (1050, 829), (1467, 826), (1399, 826), (1564, 825), (1532, 825), (1499, 825), (1433, 825),
        (1660, 823), (1629, 823), (1597, 823), (1722, 822), (1692, 822), (675, 794), (636, 794), (792, 793), (753, 793),
        (714, 793), (867, 792), (829, 792), (1086, 790), (978, 791), (941, 791), (904, 791), (1332, 789), (1297, 790),
        (1263, 790), (1192, 790), (1158, 790), (1122, 790), (1050, 790), (1014, 790), (1433, 788), (1400, 788),
        (1366, 789), (1565, 787), (1532, 787), (1499, 788), (1467, 788), (1661, 787), (1629, 787), (1597, 787),
        (1723, 785), (1692, 786), (1463, 753), (1330, 753), (1121, 753), (792, 755), (754, 755), (715, 755), (676, 755),
        (637, 755), (1497, 753), (1431, 753), (1397, 753), (1364, 753), (1296, 753), (1261, 753), (1227, 753),
        (1191, 753), (1085, 753), (1049, 753), (1013, 753), (977, 753), (941, 753), (904, 753), (867, 754), (829, 754),
        (1657, 752), (1626, 752), (1594, 752), (1562, 752), (1530, 752), (1155, 753), (1719, 751), (1688, 751),
        (1528, 718), (1461, 718), (1395, 718), (1716, 718), (1655, 718), (1623, 717), (1592, 717), (1560, 717),
        (1428, 717), (1363, 717), (1328, 717), (1294, 717), (1259, 717), (1686, 717), (1494, 717), (1225, 716),
        (1190, 716), (1155, 716), (1119, 716), (1085, 716), (1049, 716), (1013, 716), (941, 716), (793, 717),
        (755, 717), (717, 717), (678, 717), (639, 717), (904, 716), (867, 715), (831, 716), (977, 715), (1713, 685),
        (1682, 684), (1651, 684), (1523, 684), (1459, 684), (1620, 683), (1588, 683), (1556, 683), (1491, 683),
        (1425, 683), (1392, 683), (1359, 683), (1325, 682), (1291, 682), (1258, 682), (1188, 681), (1223, 681),
        (1153, 680), (1118, 680), (1084, 680), (1048, 678), (1012, 679), (940, 679), (904, 678), (794, 678), (976, 678),
        (831, 678), (718, 678), (640, 678), (868, 677), (756, 678), (679, 678), (1710, 648), (1680, 648), (1649, 648),
        (1617, 647), (1587, 647), (1522, 647), (1554, 647), (1490, 647), (1458, 646), (1424, 647), (1391, 646),
        (1358, 645), (1290, 645), (1256, 645), (1221, 644), (1187, 643), (1153, 644), (1082, 643), (1117, 643),
        (1047, 643), (1012, 643), (976, 642), (940, 642), (868, 642), (904, 641), (831, 641), (793, 641), (756, 641),
        (718, 640), (679, 640), (640, 640), (1707, 615), (1646, 614), (1615, 614), (1584, 613), (1552, 613),
        (1520, 612), (1488, 612), (1455, 612), (1423, 612), (1389, 611), (1356, 611), (1322, 610), (1289, 610),
        (1254, 609), (1220, 609), (1186, 609), (1151, 608), (1116, 608), (1082, 607), (1046, 607), (1011, 606),
        (976, 606), (941, 606), (904, 605), (868, 605), (831, 605), (795, 604), (757, 604), (719, 604), (681, 603),
        (642, 602), (1702, 582), (1672, 581), (1642, 582), (1610, 581), (1580, 580), (1549, 579), (1420, 578),
        (1517, 579), (1485, 578), (1452, 578), (1353, 578), (1386, 577), (1320, 576), (1286, 575), (1252, 575),
        (1218, 574), (1183, 574), (1150, 573), (1115, 573), (1080, 572), (1046, 572), (1010, 571), (975, 570),
        (940, 570), (904, 570), (868, 569), (831, 568), (794, 568), (757, 567), (719, 567), (681, 566), (643, 565),
        (1699, 549), (1669, 549), (1639, 548), (1608, 548), (1577, 547), (1545, 547), (1513, 545), (1483, 545),
        (1450, 544), (1418, 544), (1384, 544), (1352, 543), (1317, 542), (1284, 542), (1251, 541), (1217, 540),
        (1183, 540), (1148, 539), (1114, 538), (1080, 538), (1045, 536), (1010, 536), (976, 536), (940, 535),
        (904, 534), (869, 534), (832, 532), (795, 532), (759, 531), (721, 530), (683, 529), (645, 529), (1696, 516),
        (1667, 515), (1636, 514), (1605, 514), (1575, 513), (1544, 512), (1512, 512), (1481, 511), (1448, 509),
        (1416, 509), (1383, 509), (1350, 508), (1317, 507), (1283, 507), (1249, 506), (1215, 505), (1182, 504),
        (1148, 504), (1113, 503), (1079, 502), (1045, 501), (1009, 501), (939, 499), (903, 498), (832, 497), (795, 496),
        (758, 495), (721, 494), (683, 493), (645, 492), (1693, 483), (1664, 483), (1634, 482), (1603, 481), (1572, 480),
        (1541, 479), (1510, 478), (1478, 477), (1446, 476), (1414, 476), (1381, 475), (1348, 474), (1315, 474),
        (1282, 473), (1248, 472), (1215, 471), (1181, 470), (1147, 469), (1112, 468), (1078, 468), (1044, 467),
        (1009, 466), (974, 465), (940, 464), (904, 463), (868, 461), (832, 461), (796, 460), (759, 459), (722, 458),
        (685, 457), (1688, 452), (647, 456), (1659, 451), (1629, 451), (1598, 450), (1567, 449), (1537, 448),
        (1505, 447), (1474, 446), (1442, 445), (1410, 443), (1377, 442), (1345, 441), (1312, 441), (1279, 440),
        (1246, 439), (1212, 438), (1179, 437), (1145, 436), (1111, 435), (1077, 434), (1043, 434), (1008, 432),
        (973, 431), (938, 430), (904, 429), (868, 428), (832, 427), (796, 426), (760, 424), (722, 423), (1686, 420),
        (685, 421), (1656, 419), (1626, 419), (1565, 418), (646, 420), (1596, 417), (1534, 415), (1503, 414),
        (1472, 413), (1440, 411), (1409, 411), (1377, 409), (1343, 409), (1311, 407), (1278, 407), (1245, 406),
        (1212, 405), (1177, 403), (1145, 403), (1111, 401), (1077, 400), (1043, 399), (1008, 397), (974, 397),
        (938, 395), (904, 394), (869, 393), (833, 392), (797, 390), (760, 389), (723, 387), (1683, 387), (1654, 386),
        (1624, 385), (1593, 384), (1563, 383), (1532, 381), (1501, 380), (1470, 379), (1438, 378), (1407, 377),
        (1375, 376), (1342, 375), (1309, 373), (1276, 372), (1243, 372), (1210, 371), (1177, 369), (1143, 368),
        (1110, 367), (1076, 366), (1042, 365), (1007, 364), (973, 362), (938, 360), (903, 359), (868, 357), (833, 357),
        (797, 355), (760, 354), (723, 352), (687, 351), (649, 349)]

# 找到矩形的左下角和右上角坐标
min_x = math.floor(min([x[0] for x in list]) / 15) * 15
max_x = math.ceil(max([x[0] for x in list]) / 15) * 15
min_y = math.floor(min([y[1] for y in list]) / 15) * 15
max_y = math.ceil(max([y[1] for y in list]) / 15) * 15
print(min_x,max_y,max_x,min_y)
lie = max_x - min_x
print(lie/30)
# # 遍历可能存在的点，查找缺失点
# missing_points = []
# for x in range(min_x, max_x + 1, 15):
#     for y in range(min_y, max_y + 1, 15):
#         closest_distance = min([math.sqrt((x - point[0]) ** 2 + (y - point[1]) ** 2) for point in list])
#         if closest_distance > 15:
#             missing_points.append((x, y))
# # 显示结果
# print("缺失的点数量：", len(missing_points))
# for i, point in enumerate(missing_points):
#     row = (point[1] - min_y) // 15 + 1
#     col = (point[0] - min_x) // 15 + 1
#     print("缺失的点{0}在第{1}行第{2}列".format(i + 1, row, col))
